<style>
    body {
        background-color: #ffffff;
    }

    .layui-iconpicker-body.layui-iconpicker-body-page .hide {
        display: none;
    }
</style>

<div class="layui-form layuimini-form">


    <div class="layui-form-item">
        <label class="layui-form-label required">模块</label>
        <div class="layui-input-block">
            <select name="type" lay-verify="required">
                <option value="">请选择广告所属模块</option>
                {foreach :config('adv_module') as $k=>$vo}
                <option value="{$k}">{$vo}</option>
                {/foreach}
            </select>
            <tip>请选择广告所属模块</tip>
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label required">广告标题</label>
        <div class="layui-input-block">
            <input type="text" autocomplete="off" name="title" class="layui-input" lay-verify="required"
                   lay-reqtext="请输入广告标题"
                   placeholder="请输入广告标题" value="">
            <tip>填写广告标题</tip>
        </div>
    </div>


    {include file="layout/other/uploader_img" label="封面图" name="images" verify="required" num="1" value="" /}


    <div class="layui-form-item">
        <label class="layui-form-label required">跳转类型</label>
        <div class="layui-input-block">
            <select name="jump_type" lay-verify="required">
                <option value="">请选择跳转类型</option>
                {foreach [0=>"不跳转",1=>"内部跳转",2=>"外部跳转"] as $k=>$vo}
                <option value="{$k}">{$vo}</option>
                {/foreach}
            </select>
            <tip>请选择跳转类型</tip>
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">跳转URL</label>
        <div class="layui-input-block">
            <input type="text" autocomplete="off" name="jump_url" class="layui-input"
                   placeholder="请输入跳转URL" value="">
            <tip>填写跳转URL</tip>
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label required">权重</label>
        <div class="layui-input-block">
            <input type="text" name="weight" id="weight" lay-verify="required|number" autocomplete="off"
                   class="layui-input" value="999">
            <tip>请填入权重（数字） 数字越大 显示越靠前</tip>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            <select name="status" lay-filter="status">
                <option value="0">无效</option>
                <option value="1" selected="">有效</option>
            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
        </div>
    </div>

</div>
<script>
    layui.use(['form', 'laydate'], function () {
        var form = layui.form,
            layer = layui.layer,
            $ = layui.$;
        form.on('submit(saveBtn)', function (data) {
            var post_data = data.field;
            postData("{:url('adv/add')}", post_data, '新增成功');
            return false;
        });
    });
</script>